<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>jquery循环</title>
	<script type="text/javascript" src="../js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript">
		
		$(function(){

			// $('.list li').html('111');
			// $('.list li').css({background:'gold'});

			$('.list li').each(function(index){
				/*
					each相当于for循环,index也可以是a,b..
				*/
				$(this).html(index);
			})
		})

	</script>
</head>
<body>
	<ul class="list">
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
	</ul>
</body>
</html>